/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import io.netty.util.internal.ConcurrentSet;
/*     */ import java.util.HashMap;
/*     */ import java.util.HashSet;
/*     */ import java.util.Map;
/*     */ import java.util.Set;
/*     */ import java.util.concurrent.ConcurrentHashMap;
/*     */ import java.util.concurrent.Executors;
/*     */ import java.util.concurrent.ScheduledExecutorService;
/*     */ import java.util.concurrent.TimeUnit;
/*     */ import java.util.regex.Matcher;
/*     */ import java.util.regex.Pattern;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class tja
/*     */ {
/*     */   private static boolean d;
/*  21 */   public static final ConcurrentHashMap<String, String> z = new ConcurrentHashMap<>();
/*  22 */   private static final ConcurrentSet<String> i = new ConcurrentSet();
/*  23 */   private static final Pattern w = Pattern.compile("[%]([^%]+)[%]");
/*  24 */   private static final ScheduledExecutorService q = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors());
/*     */   
/*     */   public static void h() {
/*  27 */     q.shutdownNow();
/*     */   }
/*     */ 
/*     */   
/*     */   public static void v(String a, String str1) {
/*  32 */     if (a.startsWith("%")) {
/*  33 */       a = a.substring(1, a.length() - 1);
/*     */     }
/*  35 */     String str = z.getOrDefault(a, "");
/*  36 */     z.put(a, str1);
/*  37 */     dh.d.v("updatePlaceholder", new o[] { ah.v(a), ah.v(str1), ah.v(str) });
/*     */ 
/*     */     
/*  40 */     v(a);
/*     */   }
/*     */   
/*     */   public static String z(String a) {
/*  44 */     if (a.startsWith("%")) {
/*  45 */       a = a.substring(1, a.length() - 1);
/*     */     }
/*  47 */     return z.getOrDefault(a, "");
/*     */   }
/*     */   
/*     */   public static void v(String a, boolean bool) {
/*  51 */     if (a.startsWith("%")) {
/*  52 */       a = a.substring(1, a.length() - 1);
/*     */     }
/*     */     
/*  55 */     Map<Object, Object> map = new HashMap<>();
/*  56 */     for (Map.Entry<String, String> entry : z.entrySet()) {
/*  57 */       if (bool && ((String)entry.getKey()).startsWith(a)) {
/*  58 */         map.put(entry.getKey(), entry.getValue()); continue;
/*  59 */       }  if (((String)entry.getKey()).equals(a)) {
/*  60 */         map.put(entry.getKey(), entry.getValue());
/*     */         break;
/*     */       } 
/*     */     } 
/*  64 */     for (Map.Entry<Object, Object> entry : map.entrySet()) {
/*  65 */       z.remove(entry.getKey());
/*  66 */       dh.d.v("deletePlaceholder", new o[] { ah.v((String)entry.getKey()), ah.v((String)entry.getValue()) });
/*     */     } 
/*     */   }
/*     */   
/*     */   public static void z() {
/*  71 */     q.scheduleAtFixedRate(() -> { if (i.size() > 0) { HashMap<Object, Object> a = new HashMap<>(); for (String str1 : i) { String str2 = z(str1); a.put("%" + str1 + "%", str2); }  uy.v((HashMap)a); i.clear(); }  }500L, 500L, TimeUnit.MILLISECONDS);
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*  85 */   private static ConcurrentHashMap<String, eos/moe/dragoncore/yea> g = new ConcurrentHashMap<>();
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public static String v(String a) {
/*  97 */     if (!d) {
/*  98 */       d = true;
/*  99 */       z();
/*     */     } 
/*     */     
/* 102 */     if (a == null || !a.contains("%")) return a;
/*     */     
/* 104 */     if (!g.containsKey(a)) {
/* 105 */       Matcher matcher = w.matcher(a);
/* 106 */       Set<String> set = new HashSet();
/* 107 */       while (matcher.find()) {
/* 108 */         String str1 = matcher.group();
/* 109 */         int i = str1.indexOf("_");
/* 110 */         if (i <= 0 || 
/* 111 */           i >= str1.length()) {
/*     */           continue;
/*     */         }
/* 114 */         String str2 = z(str1);
/* 115 */         a = a.replaceAll(Pattern.quote(str1), Matcher.quoteReplacement(str2));
/* 116 */         set.add(str1.substring(1, str1.length() - 1));
/*     */       } 
/*     */       
/* 119 */       g.put(a, new eos/moe/dragoncore/yea(a, set));
/*     */     } 
/* 121 */     eos/moe/dragoncore/yea eos/moe/dragoncore/yea = g.get(a);
/* 122 */     i.addAll(eos/moe/dragoncore/yea.v(eos/moe/dragoncore/yea));
/* 123 */     return eos/moe/dragoncore/yea.v(eos/moe/dragoncore/yea);
/*     */   }
/*     */   
/*     */   public static class eos/moe/dragoncore/yea {
/*     */     private String q;
/*     */     private Set<String> g;
/*     */     
/*     */     public eos/moe/dragoncore/yea(String str, Set<String> set) {
/* 131 */       this.q = str;
/* 132 */       this.g = set;
/*     */     }
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\tja.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */